import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeContainer from '../views/HomeContainer.vue'
import MemberContainer from '../views/MemberContainer.vue'
import ShopcarContainer from '../views/ShopcarContainer.vue'
import SearchContainer from '../views/SearchContainer.vue'
import NewsList from '../components/NewsList.vue'
import NewsInfo from '../components/Newsinfo.vue'
import PhotoList from '../components/PhotoList.vue'
import Photoinfo from '../components/Photoinfo.vue'
import GoodsList from '../components/GoodsList.vue'
import GoodsInfo from '../components/GoodsInfo.vue'
import GoodsDesc from '../components/GoodsDesc.vue'
import GoodsComment from '../components/GoodsComment.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'HomeContainer',
    component: HomeContainer
  },
  {
    path: '/member',
    name: 'MemberContainer',
    component: MemberContainer
  },
  {
    path: '/shopcar',
    name: 'ShopcarContainer',
    component: ShopcarContainer
  },
  {
    path: '/search',
    name: 'SearchContainer',
    component: SearchContainer
  },
  {
    path: '/home/newslist',
    name: 'NewsList',
    component: NewsList
  },{
    path: '/home/newsinfo/:id',
    name: 'NewsInfo',
    component: NewsInfo
  },
  {
    path: '/home/photolist',
    name: 'PhotoList',
    component: PhotoList
  },
  {
    path: '/home/photoinfo/:id',
    name: 'Photoinfo',
    component: Photoinfo
  },
  {
    path: '/home/goodslist',
    name: 'GoodsList',
    component: GoodsList
  },
  {
    path: '/home/goodsinfo/:id',
    name: 'GoodsInfo',
    component: GoodsInfo
  },
  {
    path: '/home/goodsdesc/:id',
    name: 'GoodsDesc',
    component: GoodsDesc
  },
  {
    path: '/home/goodscomment/:id',
    name: 'GoodsComment',
    component: GoodsComment
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  //linkActiveClass: 'mui-active'
})

export default router
